package com.baichang.taoshunda.service;

import com.baichang.framework.excelption.ServiceException;
import com.baichang.taoshunda.entity.ReservationOrder;

import java.util.List;
import java.util.Map;

/**
 * Created by ${wushenglu} on 2018/3/13.
 */
public interface ReservationOrderService {
    /**
     * 添加预约订单
     *
     * @param reservationOrder
     * @return
     */
    boolean saveReservationOrder(ReservationOrder reservationOrder);

    /**
     * 用户确认消费预约订单
     *
     * @param orderNumber
     * @param id
     * @return
     */
    boolean userConsumeOrder(String orderNumber, Integer id) throws ServiceException;

    /**
     * 查看预约订单详情
     *
     * @param orderNumber
     * @return
     */
    List<Map<String, Object>> findReservationOrder(String orderNumber);

    /**
     * 商家确认消费预约订单
     *
     * @param orderNumber
     * @param id
     * @return
     */
    boolean companyConsumeOrder(String orderNumber, Integer id) throws ServiceException;

    /**
     * 查看预约订单预约的全部的个数
     *
     * @param orderNumber
     * @return
     */
    int getCountByOrder(String orderNumber);

    /**
     * 查看预约订单预约的未消费的个数
     *
     * @param orderNumber
     * @return
     */
    int getCountByOrderAndState0(String orderNumber);

    /**
     * 修改未消费的预约订单为退款状态
     *
     * @param orderNumber
     */
    void updateOrderState(String orderNumber);

    /**
     * 功能描述:
     *
     * @param orderNumber 订单编号
     * @return:
     * @auther: wsl
     * @date: 2019/2/20 11:38
     */
    double getAllMoneyByOrder(String orderNumber);
}
